package com.jy.api.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SaoBeiPayReq {

    private String pay_ver="100";//版本号

    private String pay_type="000";//请求类型

    private String service_id="010";//接口类型

    private String merchant_no;//商户号

    private String terminal_id;//终端号

    private String terminal_trace;//终端流水号

    private String terminal_time;//终端交易时间

    private String auth_no;//授权码

    private String total_fee;//金额

    private String key_sign; //签名检验串

    private String out_trade_no;

    private String pay_trace;

    private String pay_time;

    public SaoBeiPayReq(Order order, String authCode) {
        this.terminal_trace = order.getId();
        this.total_fee = String.valueOf((int) Math.rint(order.getAmount() * 100));
        this.auth_no=authCode;
    }



    public SaoBeiPayReq(Order order, StorePay storePay) {
        this.merchant_no = storePay.getMchId();
        this.terminal_id = storePay.getTerminalId();
        this.terminal_trace = order.getCode();
        this.pay_trace=order.getId();
    }


}
